function setAttribute(domId, attrName, value)
{
	$("[domId="+domId +"]").attr(attrName, value);
	return "";
}

function getAttribute(domId, attrName)
{
	return $("[domId="+domId+"]").attr(attrName);
}

function removeAttribute(domId, attrName)
{
	$("[domId="+domId+"]").removeAttr(attrName);
	return "";
}

function getField(fName)
{
	var dom = $("[xd_binding='"+fName+"']");
	if (dom == null)
	{
		return "";
	}
	var type = dom.attr("xd_xctname");
	if (type == "CheckBox")
	{
		if (dom.attr("checked") == "checked")
		{
			return true;
		}
		else
		{
			return false;
		}
	} 
	else if (type == "PlainText")
	{
		return dom.attr("value");
	}
	return "";
}

function setField(fName, value)
{
	var dom = $("[xd_binding='"+fName+"']");
	if (dom == null)
	{
		return "";
	}
	var type = dom.attr("xd_xctname");
	if (type == "CheckBox")
	{
		if (value == "true")
		{
			dom.attr("checked", "checked");
		}
		else
		{
			dom.removeAttr("checked");
		}
	} 
	else if (type == "PlainText")
	{
		return dom.attr("value", value);
	}
	return "";
}

function setHtml(domId, htmlText)
{
	$("[domId="+domId+"]").html(htmlText);
	return "";
}

function castStringToBoolean(value)
{
	if (value == "true")
	{
		return true;
	}
	else
	{
		return false;
	}
}


function castBooleanToString(value)
{
	if (value)
	{
		return "true";
	}
	else
	{
		return "false";
	}
}


function xslt_ture()
{
	return true;
}

function xslt_false()
{
	return false;
}

function xslt_string(value)
{
	return "" + value;
}
